<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <th:block th:replace="include/css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/addExam.css">
    <title>出题页</title>
</head>
<body>
<th:block th:replace="include/header:: header"/>
<div class="container">
    <form id="postExamForm">
        <div class="row">
            <div class="form-group">
                <label class="col-xs-1 control-label"><em class="important">*</em>分类:</label>
                <div class="col-xs-3">
                    <select class="form-control" name="categoryId" id="categoryId">
                        <option value="">请选择分类</option>
                        <option th:each="v:${categoryList}" th:value="${v.categoryId}" th:text="${v.name}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="form-group">
                <label class="col-xs-1 control-label"><em class="important">*</em>题目内容:</label>
                <div class="col-xs-8">
                    <textarea class="form-control" rows="5" name="examTitle" id="examTitle"></textarea>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="form-group">
                <label class="col-xs-1 control-label"><em class="important">*</em>答案:</label>
                <div class="col-xs-8" id="answerList">
                    <div class="row">
                        <label class="col-xs-1 control-label">A：</label>
                        <div class="col-xs-9">
                            <input name="answer" type="text" class="form-control answer" placeholder="输入答案">
                        </div>
                        <div class="col-xs-2" id="addAnswer"><a href="javascript:;">添加答案</a></div>
                    </div>
                    <div class="row">
                        <label class="col-xs-1 control-label">B：</label>
                        <div class="col-xs-9">
                            <input name="answer" type="text" class="form-control answer" placeholder="输入答案"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="form-group">
                <label class="col-xs-1 control-label"><em class="important">*</em>选择类型:</label>
                <div class="col-xs-8">
                    <label class="checkbox-inline" style="padding-left: 0;" th:each="item,l:${examChooseType}">
                        <input type="radio" th:checked="${l.index==0}" name="chooseType"
                               th:value="${item.getType()}" th:text="${item.getDesc()}"></label>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="form-group">
                <label class="col-xs-1 control-label"><em class="important">*</em>正确答案:</label>
                <div class="col-xs-8" id="rightAnswerList">
                    <label class="checkbox-inline">
                        <input name="rightAnswer" class="rightAnswer" type="checkbox" id="" value="0">A</label>
                    <label class="checkbox-inline">
                        <input name="rightAnswer" class="rightAnswer" type="checkbox" id="" value="1">B</label>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="form-group">
                <label class="col-xs-1 control-label">试题解析:</label>
                <div class="col-xs-8">
                    <textarea name="analyse" class="form-control analyse" rows="5"></textarea>
                </div>
            </div>
        </div>
    </form>
    <div class="row">
        <div class="col-xs-8"></div>
        <button class="btn btn-info" id="postExamBtn">发布试题</button>
    </div>
</div>


<th:block th:replace="include/footer:: footer"/>
<th:block th:replace="include/top"/>
<script type="text/javascript" src="/static/js/doExam.js"></script>
</body>
</html>